package cn.lzm;

import lombok.Data;

@Data
public class AjaxResult {

    private Boolean success = true;
    private String message = "操作成功";
    //调有时出创建对象
    public static  AjaxResult me(){
        return new AjaxResult();
    }
    public AjaxResult fail(String msg){
        return AjaxResult.me().setSuccess(false).setMessage(msg);
    }

    public AjaxResult fail(){
        return AjaxResult.me().setSuccess(false).setMessage("请求失败！");
    }


    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.message = message;
        return this;
    }

}
